<?

// Where are videos relative to ../ ?
$VIDEO_REL_PATH = "tbatv";

function setBasePaths($rel_path, $video_rel_path) {
    global $BASE_PATH;
    global $VIDEO_BASE_PATH;
    
    // These first two exceptions make development life easier, but in theory
    // only the third case ever happens in production.
    if ($_SERVER["SERVER_NAME"] == "localhost") {
        $serverbase = "http://localhost/tbatv"; // urls like /tbatv/tbatv/
        $videobase = $serverbase;
    } elseif ($_SERVER["SERVER_NAME"] == "dev.thebluealliance.net") {
        $serverbase = "http://" . $_SERVER["SERVER_NAME"];
        $videobase = "http://www.thebluealliance.net";
    } else {
        $serverbase = "http://" . $_SERVER["SERVER_NAME"];
        $videobase = $serverbase;
    }
    $BASE_PATH = $serverbase . "/" . $rel_path . "/";
    $VIDEO_BASE_PATH = $videobase . "/" . $video_rel_path . "/";
}

global $BASE_PATH;
global $VIDEO_BASE_PATH;
global $MOD_REWRITE_ON;
setBasePaths($REL_PATH, $VIDEO_REL_PATH);
if (!isset($MOD_REWRITE_ON)) {
    $MOD_REWRITE_ON = False;
}

?>